package com.onlinebooklibrary.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.onlinebooklibrary.fragment.GenresFragment;
import com.onlinebooklibrary.fragment.InterestingFragment;
import com.onlinebooklibrary.fragment.NewFragment;
import com.onlinebooklibrary.fragment.PopularFragment;
import com.onlinebooklibrary.fragment.RecentReadsFragment;

public class TabsPagerAdapter extends FragmentPagerAdapter {

	public TabsPagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int index) {

		switch (index) {
		case 0:
			return new PopularFragment();
		case 1:
			return new NewFragment();
		case 2:
			return new InterestingFragment();
		case 3:
			return new RecentReadsFragment();
		case 4:
			return new GenresFragment();
		}

		return null;
	}

	@Override
	public int getCount() {
		return 5;
	}

}
